package oj0413.oj0413_01;

import java.util.Scanner;

public class Main {
    public static int BF(String s, String t){
        int time = s.length() - t.length();
        for (int i = 0; i < time + 1; i++){
            int j = 0,k = i;
            while (j < t.length()){
                if (t.charAt(j) == s.charAt(k)){
                    k++;
                    j++;
                }else {
                    break;
                }
            }
            if (j == t.length()){
                return i+1;
            }
        }
        return -1;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String t = sc.next();
        int res = BF(s,t);
        System.out.println(res);
        sc.close();
    }
}
